﻿using System;
using Glue;
using Xunit;

namespace GlueTests.RelationFactoryTests
{
    public class When_properties_are_nested_and_read_only
    {
        public class GuiPerson { public GuiAddress Address { get; private set; } }
        public class DomainPerson { public DomainAddress Address { get; private set; } }

        public class GuiAddress { public String City { get; set; } }
        public class DomainAddress { public String City { get; set; } }

        [Fact]
        public void Should_be_added_as_normal()
        {
            var mapping = new Mapping<DomainPerson, GuiPerson>();
            mapping.AddConverter(new Mapping<DomainAddress,GuiAddress>());
            mapping.Relate(domain=>domain.Address,gui=>gui.Address);
        }
    }
}

